In the case of light-emitting diodes based on nitride compound semiconductors, semiconductor layers are often used which are doped with magnesium for p-conduction. During production, the semiconductor layers may be subjected to an activation step, in which hydrogen incorporated into the layer is separated from the magnesium. In particular in the case of buried semiconductor layers, insufficient activation of the magnesium may lead to an increased operating voltage of the light-emitting diode.